<ion-view view-title="{{index ? (index==1 ? '收益凭证': '天风资管') :'天风宝'}}">
    <ion-nav-buttons side="left">
        <back-button></back-button>
        <a ng-href="#/tab/search" class="btnSearch"></a>
    </ion-nav-buttons>
    <ion-content scroll-to-top="1" delegate-handle="scroller" ng-class="{'has-loading': isOffline}">

        <ion-refresher pulling-text={{PULLING_TEXT}} pulling-icon="" refreshing-text={{REFRESHING_TEXT}}
                       on-refresh="doRefresh()"></ion-refresher>

        <!--<div class="kTab clearfix">-->
            <!--<a ng-repeat="channel in channels" ng-class="{current: vm.activeTab == channel.id}" ng-click="vm.activeTab= channel.id">{{channel.catalog_name}}</a>-->
        <!--</div>-->

        <div ng-repeat="channel in channels" ng-show="vm.activeTab == channel.id">

            <div class="kBanner"><img ng-src="{{channel.large_icon}}" alt="{{channel.catalog_name}}"  ></div>
            <p ng-show="channel.products.length == 0" style="color:gray;text-align: center;padding-top:10px">暂无相关产品</p>
            <div class="kCells kMyProduct"  ng-repeat="fund in channel.products"  ng-if="channel.catalog_mark=='otcfdsy'">
                <div class="kCell">
                    <a ng-href="#/tab/{{fund.prod_profit_mode == '4' ? 'product-item-otc-float' : 'product-item-otc'}}/{{fund.prod_code}}">
                        <em>{{fund.prod_name | defString}}<i>&nbsp;{{fund.prod_code}}</i><sup ng-bind="fund.prod_attr_ext_info.otc_tag"></sup></em>
                    </a>
                    <!--<input type="checkbox" class="kAttention" ng-checked="fund.concern" ng-click="operUserCare(fund.prod_code)" ng-if="index" >-->
                </div>
                <a ng-href="#/tab/{{fund.prod_profit_mode == '4' ? 'product-item-otc-float' : 'product-item-otc'}}/{{fund.prod_code}}">
                    <div class="kCell kQuota">
                        <ul class="clearfix">
                            <li  ng-if="fund.prod_profit_mode == '4'" style="width:50%"><p>预期年化收益率</p><em class="inc">{{fund.prod_profit_rate_min|defNumber:0}}<sub>% ~</sub>{{fund.prod_profit_rate_max|defNumber:0}}<sub>%</sub></em></li>
                            <li  ng-if="fund.prod_profit_mode != '4'" style="width:50%"><p>预期年化收益率</p><em class="inc">{{fund.prod_profit_rate | defNumber :4}}<sub>%</sub></em></li>
                            <li style="width:50%"><p>起购金额</p><em ng-bind-html="fund.prod_min_subscribe"></em></li>
                        </ul>
                    </div>
                    <div class="kCell" ng-if="fund.otc_status==0">
                        <time>距离购买时间还剩{{fund.bengin_date_show | defString}}天</time>
                    </div>
                </a>
            </div>

            <div class="kCells kMyProduct"  ng-repeat="fund in channel.products"  ng-if="channel.catalog_mark!='otcfdsy'">
                <div class="kCell">
                    <a href="#/tab/{{fund.prod_profit_mode== '1' ? 'product-item-QDII' : 'product-item'}}/{{fund.prod_code}}" >
                        <em>{{fund.prod_name | defString}}<i>&nbsp;{{fund.prod_code}}</i><sup ng-if="fund.prod_attr_ext_info.otc_tag" ng-bind="fund.prod_attr_ext_info.otc_tag"></sup></em>
                    </a>
                    <!--<input type="checkbox" class="kAttention" ng-checked="fund.concern" ng-click="operUserCare(fund.prod_code)" ng-if="index" >-->
                </div>
                <a href="#/tab/{{fund.prod_profit_mode== '1' ? 'product-item-QDII' : 'product-item'}}/{{fund.prod_code}}" >
                    <div class="kCell kQuota">
                        <ul class="clearfix">
                            <li ng-if="fund.prod_profit_mode != '4'" style="width:30%"><p>近一年涨幅</p>
                                <em ng-class="{inc_ : fund.price_increase_year < 0 ,inc : fund.price_increase_year > 0}">{{fund.price_increase_year | number :2}}<sub>%</sub></em>
                            </li>
                            <li ng-if="fund.prod_profit_mode == '4'" style="width:30%"><p>预期收益率</p>
                                <em class="inc">{{fund.prod_profit_rate_min|defNumber:0}}<sub>% ~</sub>{{fund.prod_profit_rate_max|defNumber:0}}<sub>%</sub></em>
                            </li>
                            <li style="width:40%"><p>单位净值</p><em>{{fund.prod_nav | defNumber:4}}<sub>元</sub></em></li>
                            <li style="width:30%"><p>起购金额</p><em ng-bind-html="fund.prod_min_subscribe"></em></li>
                        </ul>
                    </div>
                </a>
            </div>

        </div>

        <ion-infinite-scroll on-infinite="loadMore()" distance="1%" ng-if="vm.loadMore">
        </ion-infinite-scroll>

    </ion-content>
    <scroll-to-top-button animate="true">
        <a class="backTop">↑</a>
    </scroll-to-top-button>
</ion-view>